function setReceivePerson(company){
	//getEmpbyLoginUser
	var url = "/authority/employee/getEmpbyLoginUser";
	$.post(
			url,
			{},
			function(data) {
				var expressCompany = $("#receivedPersonlist");
				expressCompany.empty(); 
				  var str = '';
				  for(var o in data) {
				str += '<option value="'+data[o].empno+'">'+data[o].ename+'</option>';
				}
				  expressCompany.append(str);
				//刷新selectpicker重新加载上面循环append部分的内容
				  expressCompany.bootstrapDualListbox("refresh");
			}
			
	);
}


function findDept(){
	var url = "/authority/department/getDeptByString";
	$.post(
			url,
			{},
			function(data) {
				var expressCompany = $("#receivedCompany");
				expressCompany.empty(); 
				  var str = '';
				  for(var o in data) {
				str += '<option value="'+data[o].companyIdStr.split(",")[0]+','+data[o].id+'">'+data[o].dname+'</option>';
				}
				  expressCompany.append(str);
				//刷新selectpicker重新加载上面循环append部分的内容
				  $('#receivedCompany.selectpicker').selectpicker('refresh');
			}
			
			);
	
	
	
}

function setReceivedPerson(value){
	var data = value.split(",");
	var url = "/authority/employee/getEmpListByDeptIdStr";
	$.post(
			url,
			{deptIdStr:data[1]},
			function(data) {
				var expressCompany1 = $("#receivedPerson");
				expressCompany1.empty(); 
				  var str = '';
				  for(var o in data) {
				str += '<option value="'+data[o].empno+'">'+data[o].ename+'</option>';
				}
				  expressCompany1.append(str);
				  $('#receivedPerson.selectpicker').selectpicker('refresh');
			}
			);
}
//根据分公司是否是当前分公司来显示隐藏员工下拉框
function setReceivedPersonShow(value){
	var data = value.split(",");
	var compamyid = $("#compamyid").val();
	 
	if(data[0]==compamyid){
		$("#receivedPersonDiv").show();
	}else{
		$("#receivedPersonDiv").hide();
		var expressCompany1 = $("#receivedPerson");
		expressCompany1.empty();
		$('#receivedPerson.selectpicker').selectpicker('refresh');
	}
}

function clearSelect(){
	var expressCompany1 = $("#receivedPerson");
	expressCompany1.empty();
	$('#receivedPerson.selectpicker').selectpicker('refresh');
	var expressCompany = $("#receivedCompany");
	expressCompany.empty(); 
	$('#expressCompany.selectpicker').selectpicker('refresh');
}

